package com.xiaohu.myspace.database.daoimple;

import org.hibernate.Session;

import com.xiaohu.myspace.database.MyHibernateDaoSupport;
import com.xiaohu.myspace.database.dao.UserInfoDao;
import com.xiaohu.myspace.database.entity.UserInfo;

public class UserInfoDaoImple extends MyHibernateDaoSupport<UserInfo> implements UserInfoDao {


	@Override
	public boolean insertUserInfo(UserInfo userInfo,Session session) {
		return insertEntity(userInfo,session);
	}

	@Override
	public UserInfo loginWithUserInfo(UserInfo userInfo,Session session) {
		String hql="from UserInfo where userName='"+userInfo.getUserName()+"' and userPassword='"+userInfo.getUserPassword()+"'";
		UserInfo user=getObjectWithHql(hql,session);
		return user;
	}

}
